import http from "@/utils/request";

/**
 * otherParams参数：
 *  isLoading：true 显示请求loading
 *  hideLoading: true 隐藏请求loading
 */

const API = {
  login: (params: Post.params) => http.post<Post.data>("/v1/Login/vCodeLogin", params),
  sceneSpeak: (params: Post.params) => http.post<Post.data>("/v1/CourseStudy/sceneSpeak", params),
  trialCourseHome: (params: Post.params) => http.post<Post.data>("/v1/TryCourse/list", params, {
    isLoading: true,
  }),
  subCourseList: (params: Post.params) => http.post<Post.data>("/v1/CourseStudy/subCourse", params),
  reviewData: (params: Post.params) => http.post<Post.data>("/v1/CourseStudy/review", params),
  dialogueTxt: (params: Post.params) => http.post<Post.data>("/v1/CourseStudy/dialogueTxt", params),
  skipPreview: (params: Post.params) => http.post<Post.data>("/v1/CourseStudy/skipPreview", params),
  getSTSServer: (isLoading: boolean = true) => http.get<Get.data>("/v1/Alists/getStsToken", null, {
    hideLoading: false,
    isLoading: isLoading
  }),
  listenTrainData: (params: Post.params) => http.post<Post.data>("/v1/CourseStudy/listen", params),
  listenTrainReport: (params: Post.params) => http.post<Post.data>("/v1/CourseStudy/listenReport", params),
  rolePlayData: (params: Post.params) => http.post<Post.data>("/v1/CourseStudy/rolePlay", params),
  rolePlayReport: (params: Post.params) => http.post<Post.data>("/v1/CourseStudy/rolePlayReport", params),
  rolePlayComplete: (params: Post.params) => http.post<Post.data>("/v1/CourseStudy/rolePlayComp", params),
  analysisData: (params: Post.params) => http.post<Post.data>("/v1/CourseStudy/analysis", params),
  previewReport: (params: Post.params) => http.post<Post.data>("/v1/CourseStudy/previewReport", params, {
    isLoading: false,
  }),
  dialogueTxtReport: (params: Post.params) => http.post<Post.data>("/v1/CourseStudy/dialogueTxtReport", params, {
    isLoading: false,
    hideLoading: false,
  }),
  sceneSpeakReport: (params: Post.params) => http.post<Post.data>("/v1/CourseStudy/sceneSpeakReport", params, {
    isLoading: false,
  }),
  repair: (params: Post.params) => http.post<Post.data>("/v1/CourseStudy/repair", params, {
    isLoading: false,
  }),
  repairPhoneme: (params: Post.params) => http.post<Post.data>("/v1/CourseStudy/repairPhoneme", params, {
    isLoading: false,
  }),
  oralImitation: (params: Post.params) => http.post<Post.data>("/v1/CourseStudy/oralImitation", params),
  oralImitationReport: (params: Post.params) => http.post<Post.data>("/v1/CourseStudy/oralImitationReport", params),
  getSelfTestCourseList: (params: Post.params) => http.post<Post.data>("/v1/CourseAnswer/sectionAnswer", params),
  getCourseAnswerData: (params: Post.params) => http.post<Post.data>("/v1/CourseAnswer/data", params),
  getCourseAnswerAnalysis: (params: Post.params) => http.post<Post.data>("/v1/CourseAnswer/analysis", params),
  getCourseAnswerResult: (params: Post.params) => http.post<Post.data>("/v1/CourseAnswer/result", params),
  setCourseAnswerReport: (params: Post.params) => http.post<Post.data>("/v1/CourseAnswer/report", params),
  setCourseAnswerReset: (params: Post.params) => http.post<Post.data>("/v1/CourseAnswer/resetAnswer", params),
  timeLongReport: (params: Post.params) => http.post<Post.data>("/v1/CourseStudy/timeLongReport", params),
  skillData: (params: Post.params) => http.post<Post.data>("/v1/CourseSpeakSkill/skillData", params),
  skillResult: (params: Post.params) => http.post<Post.data>("/v1/CourseSpeakSkill/result", params),
  skillNodeReport: (params: Post.params) => http.post<Post.data>("/v1/CourseSpeakSkill/nodeReport", params),
  skillReport: (params: Post.params) => http.post<Post.data>("/v1/CourseSpeakSkill/report", params, {
    isLoading: false,
    hideLoading: false,
  }),
  skillRepair: (params: Post.params) => http.post<Post.data>("/v1/CourseSpeakSkill/repair", params, {
    isLoading: false,
  }),
  freeTalkStart: (params: Post.params) => http.post<Post.data>("/v1/CourseFreeTalk/start", params),
  freeTalkTranslate: (params: Post.params) => http.post<Post.data>("/v1/CourseFreeTalk/translate", params),
  freeTalkRepair: (params: Post.params) => http.post<Post.data>("/v1/CourseFreeTalk/repair", params, {
    isLoading: false
  }),
  freeTalkDialogue: (params: Post.params) => http.post<Post.data>("/v1/CourseFreeTalk/dialogue", params, {
    isLoading: false
  }),
  freeTalkView: (params: Post.params) => http.post<Post.data>("/v1/CourseFreeTalk/view", params),
  freeTalkResult: (params: Post.params) => http.post<Post.data>("/v1/CourseFreeTalk/result", params),
  freeTalkReport: (params: Post.params) => http.post<Post.data>("/v1/CourseFreeTalk/timeLongReport", params, {
    isLoading: false
  }),
  shareDailyResult: (params: Post.params) => http.post<Post.data>("/v1/TryCourse/dailyResult", params),
  finishResult: (params: Post.params) => http.post<Post.data>("/v1/TryCourse/finishResult", params),
  courseCheck: (params: Post.params) => http.post<Post.data>("/v1/course/courseCheck", params),
  notStart: (params: Post.params) => http.post<Post.data>("/v1/TryCourse/notStart", params),
  oralImitationVideo: (params: Post.params) => http.post<Post.data>("/v1/CourseStudy/oralImitationVideo", params),
  shareRecord: (params: Post.params) => http.post<Post.data>("/v1/Share/record", params),
  getChivoxAuth: (params: Post.params) => http.post<Post.data>("/v1/Wechatapp/getChivoxAuth", params, {
    isLoading: false,
    hideLoading: false,
  }),
  getwrAuth: (params: Post.params) => http.post<Post.data>("/v1/Wechatapp/getwrAuth", params),

  //  Wechatapp/getChivoxAuth 获取驰声令牌
  //  Share/record 分享奖励
  //  CourseStudy/oralImitationVideo 口语模仿总结视频
  //  TryCourse/notStart 未开课页面
  //  course/courseCheck 课程入口检查
  //  TryCourse/finishResult 结业报告
  //  TryCourse/dailyResult 海报数据
  //  CourseSpeakSkill/repair 技巧学习音素修复
  //  CourseSpeakSkill/report 技巧学习驰声上报
  //  CourseSpeakSkill/nodeReport 技巧学习节点上报
  //  CourseSpeakSkill/result 总结页
  //  CourseSpeakSkill/skillData 技巧数据
  //  CourseStudy/timeLongReport 学习时长上报
  //  CourseStudy/repairPhoneme 基础课音素修复
  //  CourseStudy/repair 数据修复
  //  TryCourse/list  低价课列表
  //  CourseStudy/subCourse day4 子课列表
  //  CourseStudy/dialogueTxt 对话原文数据
  //  CourseStudy/skipPreview 对话原文跳过预习
  //  CourseStudy/previewReport 对话原文预习上报
  //  CourseStudy/dialogueTxtReport 对话原文数据上报
  //  CourseStudy/listen 听力练习数据
  //  CourseStudy/oralImitation 口语模仿数据
  //  CourseStudy/oralImitationReport 口语模仿上报
  //  CourseStudy/rolePlay 角色扮演数据
  //  CourseStudy/sceneSpeak 情景对话数据
  //  CourseStudy/sceneSpeakReport 情景对话上报
  //  CourseStudy/review 回顾概览数据
  //  CourseStudy/analysis  分析结果页
  //  CourseAnswer/resetAnswer 随课自检重新开始
  //  CourseAnswer/sectionAnswer 随课自检数据
  //  CourseAnswer/data 随课自检小节题目数据（不管是听力还是选词填空都走这个接口，返回数据不一样）
  //  CourseAnswer/report 随课自检小节答题上报 (不管是听力还是选词填空都走这个接口)
  //  CourseAnswer/analysis  随课自检小节题目解析
};

export default API;
